package com.xuecheng.teaching.convert;

import com.xuecheng.api.teaching.model.dto.WorkDTO;
import com.xuecheng.api.teaching.model.dto.WorkRecordDTO;
import com.xuecheng.api.teaching.model.vo.WorkRecordVO;
import com.xuecheng.api.teaching.model.vo.WorkVo;
import com.xuecheng.teaching.entity.Work;
import com.xuecheng.teaching.entity.WorkRecord;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface WorkRecordConvert {
    WorkRecordConvert INSTANCE = Mappers.getMapper(WorkRecordConvert.class);

    //po转换dto
    @Mapping(source = "id", target = "workRecordId")
    WorkRecordDTO entity2dto(WorkRecord workRecord);

    List<WorkRecordDTO> entitys2dtos(List<WorkRecord> entitys);

    //dot转换为po
   @Mapping(source = "workRecordId", target = "id")
   WorkRecord dto2entity(WorkRecordDTO workRecordDTO);

   //vo转换为dto
   WorkRecordDTO vo2dto(WorkRecordVO workRecordVO);






}
